package ace.module.captcha.core.impl.dao.entity;

import jakarta.annotation.Nullable;
import io.swagger.v3.oas.annotations.media.Schema;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.experimental.SuperBuilder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.annotation.Version;
import org.springframework.data.relational.core.mapping.Table;
import jakarta.validation.constraints.Size;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.NotEmpty;
import java.io.Serializable;
import ace.cmp.spring.data.jdbc.querydsl.core.annotations.LogicDelete;
import ace.cmp.spring.graphql.core.model.GenericPageContent;
import ace.module.captcha.api.model.dto.CaptchaApplicationDto;

/**
* 图形验证码应用.
*
* @author Caspar
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(title = CaptchaApplicationDto.TABLE_DESC)
@Table(CaptchaApplicationDto.TABLE_NAME)
public class CaptchaApplication implements Serializable, GenericPageContent<Long> {

  @Id
  @Schema(title = CaptchaApplicationDto.ID_TITLE, description = CaptchaApplicationDto.ID_DESC)
  private Long id;

  @Size(max = 255)
  @Schema(title = CaptchaApplicationDto.KEY_TITLE, description = CaptchaApplicationDto.KEY_DESC)
  private String key;

  @Size(max = 255)
  @Schema(title = CaptchaApplicationDto.NAME_TITLE, description = CaptchaApplicationDto.NAME_DESC)
  private String name;

  @Size(max = 255)
  @Schema(title = CaptchaApplicationDto.REMARK_TITLE, description = CaptchaApplicationDto.REMARK_DESC)
  private String remark;

  /**
   * {@link ace.module.captcha.api.enums.CaptchaApplicationStatusEnum}
   */
  @Schema(title = CaptchaApplicationDto.STATUS_TITLE, description = CaptchaApplicationDto.STATUS_DESC)
  private Integer status;

  @LogicDelete
  @Schema(title = CaptchaApplicationDto.DELETE_FLAG_TITLE, description = CaptchaApplicationDto.DELETE_FLAG_DESC)
  private Long deleteFlag;

  @CreatedDate
  @Schema(title = CaptchaApplicationDto.CREATE_TIME_TITLE, description = CaptchaApplicationDto.CREATE_TIME_DESC)
  private Long createTime;

  @LastModifiedDate
  @Schema(title = CaptchaApplicationDto.UPDATE_TIME_TITLE, description = CaptchaApplicationDto.UPDATE_TIME_DESC)
  private Long updateTime;

  @Version
  @Schema(title = CaptchaApplicationDto.ROW_VERSION_TITLE, description = CaptchaApplicationDto.ROW_VERSION_DESC)
  private Long rowVersion;

}
